package com.kevin.spring.bean;

/**
 * Created by loli on 2015/1/18.
 */
public class ServiceFactoryBean {
    public FirstServiceBean getFirstServiceBean(SecondServiceBean secondService) {
        FirstServiceBean firstService = new FirstServiceBean();
        firstService.setSecondService(secondService);
        return firstService;
    }

    public SecondServiceBean getSecondServiceBean(ThirdServiceBean thirdService) {
        SecondServiceBean secondService = new SecondServiceBean();
        secondService.setThirdService(thirdService);
        return secondService;
    }

    public ThirdServiceBean getThirdServiceBean(String name) {
        ThirdServiceBean thirdService = new ThirdServiceBean();
        thirdService.setName(name);
        return thirdService;
    }

    public static FirstServiceBean getFirstServiceBean(String name) {
        ThirdServiceBean thirdService = new ThirdServiceBean();
        thirdService.setName(name);

        SecondServiceBean secondService = new SecondServiceBean();
        secondService.setThirdService(thirdService);

        FirstServiceBean firstService = new FirstServiceBean();
        firstService.setSecondService(secondService);
        return firstService;
    }
}
